<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<lv-collapse [lvMultiExpansion]="'false'" lvType="simple">
    <lv-collapse-panel [lvTitle]="titleTpl" [lvExpanded]="true">
        <lv-form [formGroup]='formGroup'>
            <lv-form-item>
                <lv-form-label>
                    {{'protection_lvm_percent_label' | i18n}}
                    <i lv-icon="aui-icon-help" lv-tooltip="{{'protection_lvm_percent_help_label' | i18n}}"
                         lvColorState='true' class="configform-constraint"></i>
                </lv-form-label>
                <lv-form-control>
                    <div class="slider-container">
                        <div class="percent-slider">
                            <lv-slider formControlName="lvmPercentSlider" [lvMin]="10" [lvMax]="50" [lvPoints]="points"
                                [lvTrackVisible]="false" [lvHoverShowTooltip]="true"></lv-slider>
                        </div>
                        <div class="percent-input-container">
                            <lv-form-label></lv-form-label>
                            <lv-form-control [lvErrorTip]="lvmErrorTip">
                                <input lv-input type='text' class="percent-input" formControlName="lvmPercent" /> %
                            </lv-form-control>
                        </div>
                    </div>
                </lv-form-control>
            </lv-form-item>
            <lv-form-item>
                <lv-form-label>
                    {{'protection_archive_index_set_label' | i18n}}
                </lv-form-label>
                <lv-form-control>
                    <lv-switch formControlName="archive_res_auto_index"></lv-switch>
                    <div *ngIf="formGroup.value.archive_res_auto_index">
                        <i lv-icon="lv-icon-status-info" lvColorState='true' class="type-icon"></i>
                        <span>
                            {{'protection_sla_index_enable_label' | i18n}}
                        </span>
                    </div>
                </lv-form-control>
            </lv-form-item>
        </lv-form>
    </lv-collapse-panel>
</lv-collapse>

<ng-template #titleTpl>
    <lv-group lvGutter='8px'>
        <span class="aui-h3">{{'common_advanced_label'|i18n}}</span>
    </lv-group>
</ng-template>
